CREATE OR REPLACE FUNCTION text (t VARCHAR) RETURNS TEXT AS $$
BEGIN
  RETURN t::TEXT;
END
$$ LANGUAGE plpgsql STABLE STRICT;

CREATE OR REPLACE FUNCTION text2hstore(a TEXT) RETURNS HSTORE AS $$
BEGIN
  RETURN hstore_in(textout(a));
END
$$ LANGUAGE plpgsql STABLE STRICT;

CREATE OR REPLACE FUNCTION hstore2text(a HSTORE) RETURNS TEXT AS $$
BEGIN
  RETURN textin(hstore_out(a));
END
$$ LANGUAGE plpgsql STABLE STRICT;